import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
from tornado.options import define, options
import os
import string
from time import sleep

import hashlib
import json

from jpype import *
import os.path

def main():
    jvmPath = getDefaultJVMPath()
    jarpath = os.getcwd() + '/libs/NBIot.jar'
    #jvmPath = 'C:/Program Files/Java/jre1.8.0_151/bin/server/jvm.dll'
    print jvmPath
    print jarpath
    startJVM(jvmPath, "-Djava.class.path=%s" % jarpath)
    AppTaskClass = JClass("NBIot.AppTask")
    #NBIot = JPackage('NBIot')
    AppTask = AppTaskClass()

    res = AppTask.run("Hello World Jpype!")

    print res
if __name__ == "__main__":
    main()